package org.ns.summer.classpath.classreader.entity;

import java.lang.reflect.Modifier;
import java.util.Arrays;
/**
 *
 * @author 张星宇
 *
 * @email m.vip@qq.com
 *
 * class info， 暂时设置 类信息 父类信息 接口信息 注解信息 ，之后用啥在增加内容
 */
public class ClassInfo {
	private String className; // 当前类名
	private String superName; // 父类名称
	private String[] interfaces; // 接口名称集合
	private String[] annotations; // 类上拥有的注解
	private int accessFlag;
	public ClassInfo(String className, String superName, String[] interfaces, String[] annotations, int accessFlag) {
		super();
		this.className = className;
		this.superName = superName;
		this.interfaces = interfaces;
		this.annotations = annotations;
		this.accessFlag = accessFlag;
	}

	public String getClassName() {
		return className;
	}

	public String getSuperName() {
		return superName;
	}

	public String[] getInterfaces() {
		return interfaces;
	}

	public String[] getAnnotations() {
		return annotations;
	}

	@Override
	public String toString() {
		return "ClassInfo{" +
				"className='" + className + '\'' +
				", superName='" + superName + '\'' +
				", interfaces=" + Arrays.toString(interfaces) +
				", annotations=" + Arrays.toString(annotations) +
				'}';
	}
	// 是否是接口
	public boolean isInterface() {
		return Modifier.isInterface(accessFlag);
	}
	// 是否是抽象
	public boolean isAbstract() {
		return Modifier.isAbstract(accessFlag);
	}
}
